package info.techgeek.labs.regex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class GeneralValidation
{

   public static void main(String[] args) {
	
//	   String tableName = "DW_HS_TRANSATO_POS";
	   String tableName = "DW_HS_TRANSATO_POS$$";
//	   String tableName = "DWDDDDD";
//	   String tableName = "^[A-Za-z]*[_]*[A-Za-z]*$";
	   
//	   Pattern p = Pattern.compile("^[a-zA-Z][a-zA-Z0-9_]*");
	   Pattern p = Pattern.compile("(^[a-zA-Z][a-zA-Z0-9_]*)");
//	   Pattern p = Pattern.compile("(^[a-zA-Z])(-zA-Z0-9_]*)");
	   
//	   Pattern p = Pattern.compile("([a-zA-Z][a-zA-Z0-9_])");
//	   Pattern p = Pattern.compile("[a-z0-9_\\-A-Z]*");
//	   Pattern p = Pattern.compile("^[A-Za-z]*[_]*[A-Za-z0-9]*$");
	   
	   Matcher m = p.matcher(tableName);
	   
	  System.out.println("find "+m.find());
	  System.out.println("Matcher "+m.matches()); 
	   
}
} 